{% if site.gitment %}
<div id="container"></div>
<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
<script>
    var gitment = new Gitment({
        id: '{{ page.url }}',
        owner: '{{ site.gitment.owner }}',
        repo: '{{ site.gitment.repo }}',
        oauth: {
            client_id: '{{ site.gitment.oauth.client_id }}',
            client_secret: '{{ site.gitment.oauth.client_secret }}',
        },
    })
    gitment.render('container')
</script>
{% endif %}

{% if site.intensedebate_comments %}
<script>
    var idcomments_acct = '29adaa8088a33c652407b3f623e12543';
    var idcomments_post_id;
    var idcomments_post_url;
</script>
<span id="IDCommentsPostTitle" style="display:none"></span>
<script type='text/javascript' src='https://www.intensedebate.com/js/genericCommentWrapperV2.js'></script>
{% endif %}

<!--   gitalk       -->
{% if site.gitalk %}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
<div class="comment">
    <div id="gitalk-container"></div>
    <script>
        var gitalk = new Gitalk({
            clientID: '{{ site.gitalk.clientID }}',
            clientSecret: '{{ site.gitalk.clientSecret }}',
            repo: '{{ site.gitalk.repo }}',
            owner: '{{ site.gitalk.owner }}',
            admin: '{{ site.gitalk.admin }}',
            id: location.pathname, // Ensure uniqueness and length less than 50
            distractionFreeMode: false // Facebook-like distraction free mode
        })
        gitalk.render('gitalk-container')
    </script>
</div>
{% endif %}

{% if site.disqus_shortname %}
<div id="disqus_thread"></div>
<script>
    /**
     * RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
     * LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables
     */

    var disqus_config = function() {
        this.page.url = '{{ site.url }}{{ page.url }}'; // Replace PAGE_URL with your page's canonical URL variable
        this.page.identifier =
            '{{ site.url }}{{ page.url }}'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
    };

    (function() { // DON'T EDIT BELOW THIS LINE
        var d = document,
            s = d.createElement('script');

        s.src = '//{{site.disqus_shortname}}.disqus.com/embed.js';

        s.setAttribute('data-timestamp', +new Date());
        (d.head || d.body).appendChild(s);
    })();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments
        powered by Disqus.</a></noscript>
{% endif %}